package com.rds.system.service.impl;

import com.rds.common.utils.DateUtils;
import com.rds.system.domain.RdaForm;
import com.rds.system.mapper.RdaFormMapper;
import com.rds.system.service.IRdaFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * from表单Service业务层处理
 *
 * @author rds
 * @date 2021-04-19
 */
@Service
public class RdaFormServiceImpl implements IRdaFormService
{
    @Autowired
    private RdaFormMapper rdaFormMapper;

    /**
     * 查询from表单
     *
     * @param id from表单ID
     * @return from表单
     */
    @Override
    public RdaForm selectRdaFormById(Long id)
    {
        return rdaFormMapper.selectRdaFormById(id);
    }

    /**
     * 查询from表单列表
     *
     * @param rdaForm from表单
     * @return from表单
     */
    @Override
    public List<RdaForm> selectRdaFormList(RdaForm rdaForm)
    {
        return rdaFormMapper.selectRdaFormList(rdaForm);
    }

    /**
     * 新增from表单
     *
     * @param rdaForm from表单
     * @return 结果
     */
    @Override
    public int insertRdaForm(RdaForm rdaForm)
    {
        rdaForm.setCreateTime(DateUtils.getNowDate());
        return rdaFormMapper.insertRdaForm(rdaForm);
    }

    /**
     * 修改from表单
     *
     * @param rdaForm from表单
     * @return 结果
     */
    @Override
    public int updateRdaForm(RdaForm rdaForm)
    {
        return rdaFormMapper.updateRdaForm(rdaForm);
    }

    /**
     * 批量删除from表单
     *
     * @param ids 需要删除的from表单ID
     * @return 结果
     */
    @Override
    public int deleteRdaFormByIds(Long[] ids)
    {
        return rdaFormMapper.deleteRdaFormByIds(ids);
    }

    /**
     * 删除from表单信息
     *
     * @param id from表单ID
     * @return 结果
     */
    @Override
    public int deleteRdaFormById(Long id)
    {
        return rdaFormMapper.deleteRdaFormById(id);
    }
}
